<?php
/**
 * @copyright  For copyright and license information, read the COPYING.txt file.
 * @link       /COPYING.txt
 * @license    Academic Free License (AFL 3.0)
 * @package     rwd_default
 */

/**
 * @see Mage_Sales_Block_Order_Email_Creditmemo_Items
 * @var Mage_Sales_Block_Order_Email_Creditmemo_Items $this
 */
?>
<?php $_creditmemo = $this->getCreditmemo() ?>
<?php $_order      = $this->getOrder() ?>

<?php if ($_creditmemo && $_order): ?>

    <?php $_items      = $_order->getAllItems() ?>
    <?php $_itemCount  = count($_items) ?>
    <table class="items" cellpadding="0" cellspacing="0" border="0">
        <thead>
            <tr>
                <th class="cell-name">
                    <?php if($_itemCount > 1): echo $this->__('Items in your order'); else: echo $this->__('Item in your order'); endif; ?>
                </th>
                <th class="cell-name align-center">
                    <?php echo $this->__('Qty'); ?>
                </th>
                <th class="cell-name align-right">
                    <?php echo $this->__('Price'); ?>
                </th>
            </tr>
        </thead>

        <?php $i=0; foreach ($_creditmemo->getAllItems() as $_item): ?>
        <?php if($_item->getOrderItem()->getParentItem()) continue; else $i++; ?>
            <?php echo $this->getItemHtml($_item) ?>
        <?php endforeach ?>

        <tfoot>
            <?php echo $this->getChildHtml('creditmemo_totals');?>
        </tfoot>
    </table>
<?php endif ?>
